﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<P5.TestUsingOpenId.Models.LogOnModel>" %>

<asp:Content ID="loginTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Log On
</asp:Content>
<asp:Content ID="loginContent" ContentPlaceHolderID="MainContent" runat="server">

    <script language="javascript" type="text/javascript">
        var selectedOpenIdProvider;
        function SelectOpenIdProvider(openIdProvider) {
            if (selectedOpenIdProvider != openIdProvider) {
                selectedOpenIdProvider = openIdProvider;
                window.location = window.location + "?p=" + openIdProvider;
            }
        }
    </script>

    <h2>
        Log On</h2>
    <p>
        Please enter your username and password.
        <%= Html.ActionLink("Register", "Register") %>
        if you don't have an account.
    </p>
    <% using (Html.BeginForm())
       { %>
    <%= Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors and try again.") %>
    <div style="float: none;">
        <div style="width: 49%; float: left;">
            <fieldset>
                <legend>Account Information</legend>
                <div class="editor-label">
                    <%= Html.LabelFor(m => m.UserName) %>
                </div>
                <div class="editor-field">
                    <%= Html.TextBoxFor(m => m.UserName) %>
                    <%= Html.ValidationMessageFor(m => m.UserName) %>
                </div>
                <div class="editor-label">
                    <%= Html.LabelFor(m => m.Password) %>
                </div>
                <div class="editor-field">
                    <%= Html.PasswordFor(m => m.Password) %>
                    <%= Html.ValidationMessageFor(m => m.Password) %>
                </div>
                <div class="editor-label">
                    <%= Html.CheckBoxFor(m => m.RememberMe) %>
                    <%= Html.LabelFor(m => m.RememberMe) %>
                </div>
                <p>
                    <input type="submit" value="Log On" />
                </p>
            </fieldset>
        </div>
        <div style="width: 49%; float: right;">
            <fieldset>
                <legend>Using OpenID account Information</legend>
                <%= base.Html.Hidden("OpenIdProvider", "") %>
                <div style="clear: both; padding: 10px; cursor: pointer;" onclick="javascript:SelectOpenIdProvider('google');">
                    <div style="float: left;">
                        <img src="../../Content/OpenIdProviders/google_icon_normal.png" alt="" style="border: 0px;" />
                    </div>
                    <div style="float: left; padding: 10px; font-weight: bold;">
                        Sign in with Google Accounts
                    </div>
                </div>
                <div style="clear: both; padding: 10px; cursor: pointer;" onclick="javascript:SelectOpenIdProvider('yahoo');">
                    <div style="float: left;">
                        <img src="../../Content/OpenIdProviders/yahoo_icon_normal.png" alt="" style="border: 0px;" />
                    </div>
                    <div style="float: left; padding: 10px; font-weight: bold;">
                        Sign in with Yahoo! ID
                    </div>
                </div>
                <div style="clear: both; padding: 10px; cursor: pointer;" onclick="javascript:SelectOpenIdProvider('myopenid');">
                    <div style="float: left;">
                        <img src="../../Content/OpenIdProviders/myopenid_icon_normal.png" alt="" style="border: 0px;" />
                    </div>
                    <div style="float: left; padding: 10px; font-weight: bold;">
                        Sign in with MyOpenID
                    </div>
                </div>
            </fieldset>
        </div>
    </div>
    <% } %>
    <div style="clear: both;">
    </div>
</asp:Content>
